package com.lysj.bhp.user.repository;



import com.lysj.bhp.user.domain.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.Date;
import java.util.List;


public interface UserRepository extends JpaRepository<User, Long>, JpaSpecificationExecutor {

    User findByPhone(String phone);

    User findByToken(String token);

    User findByEmail(String email);

    User findByForgetCode(String forgetCode);

    User findByIdNum(String idNum);

    User findByUserId(Long userId);

    List<User> findByStatus(int status);

    List<User> findByPhoneLikeAndRegisterDateBetweenOrderByRegisterDateDesc(String phone, Date begin, Date end);

    List<User> findByRegisterDateBetween(Date beginDate, Date endDate);

    List<User> findByRegisterDateBetweenAndStatus(Date beginDate, Date endDate, Integer status);

    User findByEmailAndStatus(String email,int status);


    /**
     * @author wtl
     * @date 2018-03-08 17:15
     * @Description 通过激活码获取用户
     */
    User findByActiveCode(String activeCode);




}
